import Vue from 'vue'
import Router from 'vue-router'
import Test from '@/pages/test'
import Index from '@/pages/index'
import Login from '@/pages/login'
import Order from '@/pages/order'
import Register from '@/pages/register'
import About from '@/pages/about'
import ApplyShop from '@/pages/applyShop'
import MyAccount from '@/pages/myAccount'
import Info from '@/pages/Info'
import Partner from '@/pages/partner'
import ShopCar from '@/pages/shopCar'
import Forget from '@/pages/forget'
import error from '@/pages/404'
// import ApplyShop from '@/pages/applyShop'

Vue.use(Router)

export default new Router({
	mode: 'history',
	scrollBehavior(to, from, savedPosition) {　　　　　　　　
		if(to.hash) {　　　　　　　　　　
			return {　　　　　　　　　　　　
				selector: to.hash　　　　　　　　　　
			}　　　　　　　　
		}　　　　　　
	},
	routes: [{
			path: '/test',
			name: 'Test',
			component: Test
		},
		{
			path: '/',
			name: 'Index',
			component: Index
		},
		{
			path: '/login',
			name: 'Login',
			component: Login
		},
		{
			path: '/order',
			name: 'Order',
			component: Order
		},
		{
			path: '/register',
			name: 'Register',
			component: Register
		},
		{
			path: '/about',
			name: 'About',
			component: About
		},
		{
			path: '/applyShop',
			name: 'ApplyShop',
			component: ApplyShop
		},
		{
			path: '/myAccount',
			name: 'MyAccount',
			component: MyAccount
		},
		{
			path: '/info',
			name: 'Info',
			component: Info
		},
		{
			path: '/partner',
			name: 'Partner',
			component: Partner
		},
		{
			path: '/shopCar',
			name: 'ShopCar',
			component: ShopCar
		},
		{
			path: '/forget',
			name: 'Forget',
			component: Forget
		},
		{
			path: '*',
			name: '404',
			component: error
		}
	]
})